import { api } from "@/lib/api"; import { countryName, fmtInt } from "@/lib/format"; import { OG_CONTENT_TYPE, OG_SIZE, renderOg } from "@/lib/og-template"; export const alt = "DataCenterIndex internet exchange"; export const size = OG_SIZE; export const contentType = OG_CONTENT_TYPE; export const revalidate = 3600; export default async function Image({ params }: { params: Promise<{ slug: string }> }) { const { slug } = await params; const r = await api.ixp(slug); if (!r.ok) return renderOg({ eyebrow: "Internet exchange", title: "DataCenterIndex internet exchanges", subtitle: "Exchange points, connected networks and the facilities where they are present." }); const d = r.data; const country = d.countryName ?? (d.countryIso2 ? countryName(d.countryIso2) : null); return renderOg({ eyebrow: "Internet exchange", title: d.name, subtitle: [d.nameLong && d.nameLong !== d.name ? d.nameLong : null, [d.city, country].filter(Boolean).join(", ")].filter(Boolean).join(" · ") || undefined, stats: [ { label: "Networks", value: d.networkCount === null ? "—" : fmtInt(d.networkCount) }, { label: "Facilities", value: fmtInt(d.facilityCount) }, { label: "Country", value: country ?? "—" }, ], }); }